package com.wee.cronos.client.gin;

import com.google.inject.Singleton;
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
import com.gwtplatform.mvp.client.gin.DefaultModule;
import com.wee.cronos.client.core.presenter.FolderExplorerPresenter;
import com.wee.cronos.client.core.presenter.ProjectExplorerPresenter;
import com.wee.cronos.client.core.presenter.ProjectManagementPresenter;
import com.wee.cronos.client.core.presenter.WorkspacePresenter;
import com.wee.cronos.client.core.view.FolderExplorerViewImpl;
import com.wee.cronos.client.core.view.ProjectExplorerViewImpl;
import com.wee.cronos.client.core.view.ProjectManagementViewImpl;
import com.wee.cronos.client.core.view.WorkspaceViewImpl;
import com.wee.cronos.client.place.CronosPlaceManager;
import com.wee.cronos.client.place.DefaultPlace;
import com.wee.cronos.client.place.NameTokens;
import com.wee.cronos.client.resources.Resource;

public class CronosModule extends AbstractPresenterModule 
{
	@Override
	protected void configure() 
	{
		//Singletons
		install(new DefaultModule(CronosPlaceManager.class));
		
		//Constants
		bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.projectExplorer);
		
		// Singletons
	    bind(Resource.class).in(Singleton.class);
		
		//Presenters
		bindPresenter(WorkspacePresenter.class, WorkspacePresenter.WorkspaceView.class, WorkspaceViewImpl.class, WorkspacePresenter.WorkspaceProxy.class);
		bindPresenter(ProjectManagementPresenter.class, ProjectManagementPresenter.ProjectManagementView.class, ProjectManagementViewImpl.class, ProjectManagementPresenter.ProjectManagementProxy.class);
		bindPresenter(FolderExplorerPresenter.class, FolderExplorerPresenter.FolderExplorerView.class, FolderExplorerViewImpl.class, FolderExplorerPresenter.FolderExplorerProxy.class);
		bindPresenter(ProjectExplorerPresenter.class, ProjectExplorerPresenter.ProjectExplorerView.class, ProjectExplorerViewImpl.class, ProjectExplorerPresenter.ProjectExplorerProxy.class);
	}

}
